from scipy.interpolate import griddata
import numpy as np

# 定义数据点
points = np.random.rand(100, 2)
values = np.sin(points[:, 0]) + np.cos(points[:, 1])

# 定义网格
grid_x, grid_y = np.mgrid[0:1:100j, 0:1:100j]

# 插值
grid_z = griddata(points, values, (grid_x, grid_y), method='cubic')